<%@ page language="java" contentType="text/html; charset=UTF-8" import="org.springframework.ui.ModelMap" import="java.util.*,com.device.operating.entity.*"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/xasj/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/xasj/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="/xasj/easyui/themes/color.css">
<script type="text/javascript" src="/xasj/easyui/jquery.min.js"></script>
<script type="text/javascript" src="/xasj/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(function(){//延迟加载
	$('#adddvmodel').click(function(){
		if($('#subdvmodel').form('validate')){
			var str = new Array();
			var zhukong='';
			str=$('#zhukong').combobox('getValues');
			for(var i=0;i<str.length;i++){
				zhukong=zhukong+str[i]+',';
			}
			zhukong=zhukong.substring(0,zhukong.length-1);
			$.ajax({
				url:'adddvmodel',
				type:'POST',
				data:{
					dvfirm:$('#dvfirm').combobox('getValue'),
					devresId:$('#dvbelong').combobox('getValue'),
					zhukong:zhukong,
					portnum:$('#portnum').val(),
					boardport:$('#boardport').val(),
					ylport:$('#ylport').val(),
					dvmodel:$('#dvmodel').val(),
					beizhu:$('#beizhu').val()
				},
				success:function(data){
					alert(data.msg);
				}
			});			
		}else{
			alert('资料不完整');
		}
	});
});
</script>
</head>
<%
List<Dvfirm> listfirm=(List<Dvfirm>)request.getAttribute("listfirm"); 
List<Devres> ld=(List<Devres>)request.getAttribute("ld");
%>
<body >
<div style="padding-left:30%">
<form id="subdvmodel">
<table>
<tr>
<td style="width:100px">
设备厂商：
</td>
<td>
	<select id="dvfirm" class="easyui-combobox" data-options="required:true" panelHeight="auto" style="width:130px">
	<%for(Dvfirm dvfirm:listfirm){%>
	<option value="<%=dvfirm.getDvfirmId()%>"><%=dvfirm.getDvfirm()%></option>	
	<%}%>
	</select>
</td>
</tr>
<tr>
<td style="width:100px">
设备类型：
</td>
<td>
	<select id="dvbelong" class="easyui-combobox" data-options="required:true" panelHeight="auto" style="width:130px">
	<%for(Devres dv:ld){%>
	<option value="<%=dv.getDevresId()%>"><%=dv.getDevresname()%></option>	
	<%}%>
	</select>
</td>
</tr>
<tr>
<td>
主控板：
</td>
<td>
	<select id="zhukong" class="easyui-combobox" data-options="required:true,multiple:true" panelHeight="auto" style="width:130px">
	<%for(int i=0;i<20;i++){if(i==9){%>
		<option selected="true" value="<%=i%>"><%=i+"板"%></option>
	<%}else{%>
	<option value="<%=i%>"><%=i+"板"%></option>	
	<%}}%>
	</select>
</td>
</tr>
<tr>
<td>
端口总数：
</td>
<td>
<input id="portnum" class="easyui-numberbox" data-options="required:true" value=112 style="width:130px">
</td>
</tr>
<tr>
<td>
每板端口数：
</td>
<td>
<input id="boardport" class="easyui-numberbox" data-options="required:true" value=8 style="width:130px">
</td>
</tr>
<tr>
<td>
预留端口数：
</td>
<td>
<input id="ylport" class="easyui-numberbox" data-options="required:true" value=4 style="width:130px">
</td>
</tr>
<tr>
<td>
设备型号：
</td>
<td>
<input id="dvmodel" class="easyui-validatebox" data-options="required:true"style="width:130px"/>
</td>
</tr>
<tr>
<td>
备注：
</td>
<td>
<input id="beizhu" value="无" data-options="multiline:true" style="height:60px;width:200px">
</td>
</tr>
<tr>
<td>
</td>
<td>
<a id=adddvmodel class="easyui-linkbutton c8" style="width:100px">提交</a>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>